package com.geek.framework.study.config.microprofile.converter;

public class ClassConverter extends AbstractConverter<Class>{

    private final ClassLoader classLoader;

    public ClassConverter() {
        this(Thread.currentThread().getContextClassLoader());
    }

    public ClassConverter(ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    @Override
    protected Class doConvert(String value) throws ClassNotFoundException {
        return classLoader.loadClass(value);
    }

}
